<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>竞赛界面</title>
</head>
<link rel="stylesheet" href="../css/daojishi.css" />
<link rel="stylesheet" href="../css/styles.css" />
<link rel="stylesheet" href="../css/jquery.countdown.css" />
<script src="../plugs/layui/dist/layui.js"></script>
<link href="../plugs/layui/dist/css/layui.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery.min.js"></script>
<link rel="stylesheet" href="../css/problem.css">
<script type="text/javascript" src="../js/head-nav.js"></script>

<body>
  <br>

  <div class="layui-row layui-col-space12">
    <div class="layui-col-md1">
      <!-- 空白 -->
    </div>
    <div class="layui-col-md10">
      <div class="layui-panel">
        <div style=" background-image: url(../image/competition.png); height: 400px; width: 100%;"></div>
      </div>

      <div id="countdown"></div>

      <p id="note"></p>
      <script src="../js/jquery.countdown.js"></script>
      <script src="../js/script.js"></script>
      <div style="text-align:center;clear:both; font-size:12px; margin-top:100px;">
        <button type="button" class="layui-btn layui-btn-fluid layui-btn-normal" onclick="Enroll()">报名参赛</button>
      </div>
      <div class="layui-col-md1">
        <!-- 空白 -->
      </div>
    </div>
  </div>
  <script src="../js/bottom-nav.js"></script>
  <script>

    Enroll = function () {
      token = localStorage.getItem("token");
      console.log(token == null)
      if (token == null) {
        alert("请先登录")
      }
      else{
        $.ajax({
        type: "get",
        url: "http://localhost:70/devc/competition/enroll/1",
        headers: { token: token },
        success: function (res) {
          layer.alert(res.msg, {icon: 6});
        }
      })
      }
   
    }
  </script>
</body>

</html>